﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;

namespace Maticsoft.Web
{
    public partial class Content : System.Web.UI.Page
    {
        int _ChannelId;
        int _ClassId;
        protected Model.Channel chaModel;
        protected void Page_Load(object sender, EventArgs e)
        {
            int.TryParse(Request.QueryString["channelId"], out _ChannelId);
            int.TryParse(Request.QueryString["classId"], out _ClassId);

            GetSiteInfo();
            BindData();
            GetNav();
        }

        protected void GetNav()
        {
            StringBuilder strBuilder = new StringBuilder();
            strBuilder.Append("&nbsp; 首页 > ");
            BLL.Channel channelBll = new BLL.Channel();
            Model.Channel channelModel = channelBll.GetModel(_ChannelId);
            strBuilder.Append(channelModel.ChannelName);
            nav.InnerHtml = strBuilder.ToString();
        }

        protected void BindData()
        {
            BLL.Channel chaBll = new BLL.Channel();
            chaModel = chaBll.GetModel(_ClassId);
        }

        protected void GetSiteInfo()
        {
            BLL.WebSiteConfig bll = new BLL.WebSiteConfig();
            Model.WebSiteConfig model = bll.GetModelByCache(1);
            Title = model.SiteName;
            MetaKeywords = model.KeyWords;
            MetaDescription = model.Description;
        }
    }
}